package com.ymy.thinking.in.spring.bean.instance;

import com.ymy.thinking.in.spring.bean.entity.Person;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;

/**
 * @author Ringo
 * @date 2021/8/27 20:37
 */
@Component
public class PersonFactoryBean implements FactoryBean<Person> {

    @Override
    public Person getObject() throws Exception {
        Person person = new Person();
        person.setName("李明");
        person.setAge(30);
        return person;
    }

    @Override
    public Class<?> getObjectType() {
        return Person.class;
    }
}
